
local sysfunc = function(ecs)
    local _sys = ecs:system('TimeSystem', 1)
    _sys:on({'Time'},function(ent)
        ecs.global.time = 0
        ecs.global.dt = 0
    end)

    _sys:onUpdate({'Time'},function(dt,ents)
        if not ents[1] then return end
        ecs.global.time = ecs.global.time + dt
        ecs.global.dt = dt
    end)
end

return sysfunc
